<body  onload="initMap()">
    <div class="x-body">
        <div class="col-md-3">
            <div id="mapContainer" style="min-width:500px;min-height:500px;"></div>
        </div>
    </div>
</body>
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77"></script>
<script>
    var map;
    function initMap() {
        if ($('#{$config.name}').val() != '') {
            var center = new qq.maps.LatLng({$config.value});
        } else {
            var center = new qq.maps.LatLng(39.984154, 116.307490);
        }
        map = new qq.maps.Map(document.getElementById('mapContainer'), {
            center: center,
            zoom: 13
        });
        marker = new qq.maps.Marker({
                position: center,
                draggable: true,
                map: map
            });
            //添加到提示窗
            var info = new qq.maps.InfoWindow({
                map: map
            });
            info.open();
            info.setContent('<div style="text-align:center;white-space:nowrap;' +
                'margin:10px;">坐标：' + center + '</div>');
            info.setPosition(center);
            // 点击事件获取坐标
            qq.maps.event.addListener(marker, 'mouseup', function(e) {
            info.open();
            info.setContent('<div style="text-align:center;white-space:nowrap;' +
                    'margin:10px;">坐标：' + e.latLng.lat + ',' + e.latLng.lng + '</div>');
            info.setPosition(e.latLng);
            $('#{$config.name}').val(e.latLng.lat + ',' + e.latLng.lng);
        });
    }
</script>